public class Numbers
{
   /**
      Counts the number of 7s in a given number
      @param num a number >= 0
      @return the number of digits in num that are 7
   */
   public static int countSevens(int num)
   {
      int a,b=0;
      int s=num;
      while(s!=0){
         a=s%10;
         s=s/10;
         if(a==7){
            b++;
         }
      }
      return b;
   }
}